package y2017.date0930.MariaDB链接;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class MariaDBDog {
    public void start() {
        try {
            // 注册数据库驱动
            Class.forName("org.mariadb.jdbc.Driver");
            Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306", "root", "root");
            // 创建 Statement
//			Statement stmt = conn.createStatement();
            // 执行查询
            System.out.println(conn.getMetaData().getDatabaseProductVersion());
        } catch (ClassNotFoundException | SQLException e) {
            e.printStackTrace();
        }
    }
}
